package com.caoheng.pay.controller;

import com.caoheng.core.common.Result;
import com.caoheng.core.common.body.PayRequestBody;
import com.caoheng.pay.service.ThirdPayService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName ThirdPayController
 * @Description 第三方支付接口
 * @Author shuimodanqing
 * @Date 2018/12/24 10:46 AM
 */
@Api(tags = "第三方支付接口")
@RestController
@RequestMapping("/third_pay")
public class ThirdPayController {

    @Autowired
    private ThirdPayService thirdPayService;

    @ApiOperation(value = "订单支付")
    @PostMapping("/order")
    public Result payOrder(@Validated @RequestBody PayRequestBody requestBody){
        return thirdPayService.payOrder(requestBody);
    }

    @ApiOperation(value = "支付订单列表")
    @GetMapping("/order/list")
    public Result payOrderList(){
        return null;
    }

    @ApiOperation(value = "退款单列表")
    @GetMapping("/refund/list")
    public Result refundList(){
        return null;
    }

    @ApiOperation(value = "订单退款")
    @PostMapping(value = "/refund/{orderNo}")
    public Result orderRefund(@PathVariable String orderNo){
        return null;
    }

}
